load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
    name = "lidar_device",
    srcs = glob(
        [
            "**/*.cc",
            "**/*.h",
        ],
        exclude = [
            "ut/lidar_test.cc",
            "test_tool/test_tool.cc"
        ],
    ),
    deps = [
        "//base/device_connect/proto:lidar_data_cc_pb",
    ], 
)

cc_test(
    name = "lidar_ut",
    srcs = [
        "ut/lidar_test.cc",
        "device_factory.h",
        "device_base.h",
    ],
    includes = [
        ".",
    ],
    linkopts = [
        "-L/airos/bazel-bin/base/device_connect/lidar",
        "-llidar_device",
        "-pthread -lz"
    ],
    deps = [
        "@protobuf_import//:protobuf_import",
        "@com_google_googletest//:gtest_main",
        "//base/device_connect/proto:lidar_data_cc_pb",
    ]
)

cc_binary(
    name = "lidar_test_tool",
    srcs = [
        "test_tool/test_tool.cc",
        "device_factory.h",
        "device_base.h",
    ],
    includes = [
        ".",
    ],
    linkopts = [
        "-L/airos/bazel-bin/base/device_connect/lidar",
        "-llidar_device",
        "-pthread -lz"
    ],
    deps = [
        "@protobuf_import//:protobuf_import",
        "@yaml_cpp//:yaml_cpp",
        "//base/device_connect/proto:lidar_data_cc_pb",
    ],
)
